package software.hust.com.hust_last.util;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import butterknife.BindView;
import software.hust.com.hust_last.R;


public class LoadMoreItem extends RecyclerItem {

    @BindView(R.id.load_more_bottom)
    View mBottomView;
    @BindView(R.id.load_more_loading)
    View mLoadingView;
    @BindView(R.id.load_more_root)
    View mRootView;

    public LoadMoreItem(Context context, ViewGroup parent) {
        super(context, parent);
    }

    @Override
    protected int getLayout() {
        return R.layout.rv_load_more_item;
    }

    public void setLoading(boolean isLoading) {
        if (isLoading) {
            mLoadingView.setVisibility(View.VISIBLE);
            mBottomView.setVisibility(View.GONE);
        } else {
            mLoadingView.setVisibility(View.GONE);
            mBottomView.setVisibility(View.VISIBLE);
        }
    }

    public void setVisibility(int visibility) {
        mRootView.setVisibility(visibility);
    }

    @Override
    protected void bindDataImpl(int position, Object data) {
    }
}
